import { getRequest, postRequest, putRequest } from '@/utils/request'

export const examApi = {
  // 考试列表(搜索)
  examList: (params = {}) => {
    return getRequest('/v1/api/exam/search', params)
  },
  // 考试详情
  examDetail: (params = {}) => {
    return getRequest('/v1/api/exam/view', params)
  },
  // 排行榜
  examRankPage: (params = {}) => {
    return getRequest('/v1/auth/exam/rank/page', params)
  },
  // 考试详情(登录后)
  examUserDetail: (params = {}) => {
    return getRequest('/v1/auth/exam/view', params)
  },
  // 考试报名
  examRegistration: (params = {}) => {
    return postRequest('/v1/auth/exam/registration', params)
  },
  // 考试校验
  examCheck: (params = {}) => {
    return getRequest('/v1/auth/exam/check', params)
  },
  // 开始考试
  examStart: (params = {}) => {
    return postRequest('/v1/auth/exam/start', params)
  },
  // 继续考试
  examContinue: (params = {}) => {
    return postRequest('/v1/auth/exam/continue', params)
  },
  // 保存答案
  examAnswerSave: (params = {}) => {
    return postRequest('/v1/auth/exam/save/answer', params)
  },
  // 交卷
  examEnd: (params = {}) => {
    return postRequest('/v1/auth/exam/end', params)
  },
  // 考试报告结果
  examReport: (params = {}) => {
    return getRequest('/v1/auth/exam/report', params)
  },
  // 考试解析
  examParse: (params = {}) => {
    return getRequest('/v1/auth/exam/parse', params)
  },
  // 考试记录
  examRecordPage: (params = {}) => {
    return getRequest('/v1/auth/exam/record/page', params)
  },
  // 记录切屏次数
  examSwitchScreen: (params = {}) => {
    return putRequest('/v1/auth/exam/update/switch/screen/count', params)
  },

  // 用户中心-考试记录
  examUserPage: (params = {}) => {
    return getRequest('/v1/auth/exam/user/page', params)
  }
}
